<?php
Util::tsRegisterAssetJs('_form.js');
$baseUrl = Yii::app()->baseUrl;
?>

<!--<div class="form-actions-float flotante" style="right: 0; left:initial;">-->
<!--<div style="float:right;">-->
<a id="btn_finalizar" class="btn btn-primary btn-info" type="button" style="<?php echo $model->isNewRecord ? 'display: none' : 'display: inline-block' ?>" href="<?php echo $model->isNewRecord ? '' : $baseUrl . '/clientes/persona/view/id/' . $model->id_persona ?>"><i class="icon-signout icon-white"></i> Finalizar </a>

<?php
$this->widget('bootstrap.widgets.TbButton', array(
    'type' => 'success',
    'icon' => 'ok',
    'label' => $model->isNewRecord ? Yii::t('AweCrud.app', 'Guardar') : Yii::t('AweCrud.app', 'Save'),
    'htmlOptions' => array(
        'style' => $model->isNewRecord ? 'display: inline-block' : 'display: none',
        'id' => 'btn_crearPersona',
        'class' => 'btn-primary btn',
        'onClick' => 'js:save("#persona-form")')
));
?>
<?php
$this->widget('bootstrap.widgets.TbButton', array(
    'icon' => 'remove',
    'label' => Yii::t('AweCrud.app', 'Cancel'),
    'htmlOptions' => array(
        'class' => 'btn-danger btn',
        'onclick' => 'javascript:history.go(-1)')
));
?>
<div class="space15"></div>
<div class="row-fluid" id="dv_cuenta">
    <?php
    $form = $this->beginWidget('ext.AweCrud.components.AweActiveForm', array(
        'id' => 'persona-form',
        'type' => 'horizontal',
        'enableAjaxValidation' => true,
        'clientOptions' => array('validateOnSubmit' => true, 'validateOnChange' => false,),
        'enableClientValidation' => true,
    ));
    ?>
    <!--<div class="span12">-->
    <div class="widget orange">
        <div class="widget-title">
            <h4><i class="icon-briefcase"></i> <?php echo Yii::t('AweCrud.app', $model->isNewRecord ? 'Create' : 'Update') . ' ' . Persona::label(); ?></h4>
            <span class="tools">
                <a href="javascript:;" class="icon-chevron-down"></a>
                <!--a href="javascript:;" class="icon-remove"></a-->
            </span>
        </div>
        <?php
//        $this->widget('CMultiFileUpload', array(
//            'model' => $model,
//            'name' => 'foto',
//            'attribute' => 'images',
//            'accept' => 'jpg|gif|png', // useful for verifying files
//            'duplicate' => 'Archivo Duplicado', // useful, i think
//            'denied' => 'Tipo de archivo de valido', // useful, i think
//            'max' => 10
//        ));
        ?>
        <div class="widget-body">
            <div class="row-fluid">
                <div class="span6">
                    <!--almacenar la foto-->
                    <?php echo $form->hiddenField($model, 'id_persona') ?>
                    <?php echo $form->textFieldRow($model, 'cedula', array('maxlength' => 10)) ?>
                    <?php echo $form->textFieldRow($model, 'foto', array('maxlength' => 50)) ?>
                    <div class="space20"></div>
                    <?php echo $form->dropDownListRow($model, 'id_grado', array('' => ' -- Seleccione -- ') + CHtml::listData(Grado::model()->findAll(), 'id_grado', Grado::representingColumn())) ?>
                    <?php echo $form->textFieldRow($model, 'apellidos', array('maxlength' => 50)) ?>
                    <?php echo $form->textFieldRow($model, 'nombres', array('maxlength' => 50)) ?>
                    <?php echo $form->textFieldRow($model, 'peloton', array('maxlength' => 2)) ?>
                    <?php echo $form->textFieldRow($model, 'codigo_isffa', array('maxlength' => 20)) ?>
                </div>
                <div class="span6">
                    <?php // echo $form->datepickerRow($model, 'fecha_nacimiento', array('prepend' => '<i class="icon-calendar"></i>')) ?>
                    <?php
                    echo $form->datepickerRow(
                            $model, 'fecha_nacimiento', array(
                        //'class' => 'span3',
                        'options' => array(
                            'autoclose' => 'true',
                            'language' => 'es',
                            'format' => 'yyyy-mm-dd',
                            'startView' => 2,
                            'orientation' => 'bottom right',
                        ),
                    ));
                    ?>
                    <?php // echo $form->textFieldRow($model, 'id_provincia') ?>
                    <?php echo $form->dropDownListRow($model, 'id_provincia', array('' => ' -- Seleccione -- ') + CHtml::listData(Provincia::model()->findAll(), 'id_provincia', Provincia::representingColumn())) ?>
                    <?php echo $form->textFieldRow($model, 'ciudad', array('maxlength' => 50)) ?>
                    <?php echo $form->textFieldRow($model, 'numero_cuenta', array('maxlength' => 50)) ?>
                    <?php echo $form->textFieldRow($model, 'fusil', array('maxlength' => 50)) ?>
                    <?php // echo $form->textFieldRow($model, 'id_tipo_sangre') ?>
                    <?php echo $form->dropDownListRow($model, 'id_tipo_sangre', array('' => ' -- Seleccione -- ') + CHtml::listData(TipoSangre::model()->findAll(), 'id_tipo_sangre', TipoSangre::representingColumn())) ?>
                    <?php echo $form->dropDownListRow($model, 'id_licencia', array('' => ' -- Seleccione -- ') + CHtml::listData(Licencia::model()->findAll(), 'id_licencia', Licencia::representingColumn())) ?>
                    <?php echo $form->dropDownListRow($model, 'id_vuelo', array('' => ' -- Seleccione -- ') + CHtml::listData(Vuelo::model()->findAll(), 'id_vuelo', Vuelo::representingColumn())) ?>
                    <?php echo $form->dropDownListRow($model, 'id_genero', array('' => ' -- Seleccione -- ') + CHtml::listData(Genero::model()->findAll(), 'id_genero', Genero::representingColumn())) ?>
                </div>
            </div>
        </div>
    </div>
    <!--</div>-->


</div>
<?php $this->renderPartial('steps/_direccion', array('model' => $model)) ?>
<div class="row-fluid" id="dv_email_telefono">
    <div class="span6">
        <?php $this->renderPartial('steps/_emails', array('model' => $model)) ?>
    </div>
    <div class="span6">
        <?php $this->renderPartial('steps/_telefonos', array('model' => $model)) ?>
    </div> 


</div>
<div class="row-fluid" id="dv_alergias_pariente">

    <div class="span6">
        <?php $this->renderPartial('steps/_alergias', array('model' => $model)) ?>
    </div>
    <div class="span6">
        <?php $this->renderPartial('steps/_pariente', array('model' => $model)) ?>
    </div>

    <!--<div class="space100"></div>-->
</div>


<?php $this->endWidget(); ?>
<!--<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=places"></script>
<script src="<?php // echo Yii::app()->theme->baseUrl;            ?>/js/gmaps.js"></script>-->